package com.bdc.Quartz

import java.time.LocalDateTime

import com.bdc.Util.QuartzUtil

object StartOrShutDownQuartz {

  def startJobs(): Unit = {
    println("开启定时任务：车辆数据推送至Redis!" + LocalDateTime.now())
    QuartzUtil.startJobs()
  }

  def main(args: Array[String]): Unit = {
    //添加一个定时任务，每周天1点，添加时会启动定时任务
    QuartzUtil.addJob("CalDetrial", classOf[QueryVehicleToRedis], "0 0 1 ? * SUN")
  }

  def shutDownJobs(): Unit = {
    println("关闭所有定时任务!" + LocalDateTime.now())
    QuartzUtil.shutdownJobs()
  }

}
